//
//  PPJsonHelper.m
//  PiPi
//
//  Created by 邓标祥 on 2020/12/19.
//  Copyright © 2020 PiPiWholseSale. All rights reserved.
//

#import "PPJsonHelper.h"

#import "YYModel.h"

@implementation PPJsonHelper
+ (id)modelWithData:(NSDictionary *)data toClass:(Class)classModel{
    id model = [classModel yy_modelWithDictionary:data];
    return model;
}

+ (NSArray *)modelArrayWithData:(NSArray *)data toClass:(Class)classModel{
    NSArray *array = [NSArray yy_modelArrayWithClass:classModel json:data];
    return array;
}

+ (NSDictionary *)dictionaryWithModel:(id)classModel{
    
   NSDictionary *dict = [classModel yy_modelToJSONObject];
    if ([dict isKindOfClass:[NSDictionary class]]) {
        return dict;
    }else{
        return nil;
    }
}
@end
